
function DrawMsg() {
	
	function setUser(user_name, color, classname) {
		var show_user = document.getElementsByClassName(classname);
		show_user[0].innerHTML = user_name.substring(0, 1);
		show_user[0].style.color = color;
	}
	return {
		drawMsg: function (username, color, msg, me) {
			var show = document.getElementById("msg");
			// console.log(me);
			if (me > 0) {
				show.innerHTML = "<div class='msg_right'><div class='show_user right-user'></div><div class='show_msg'><div class='show_text'>"+ msg + "</div></div></div>" + show.innerHTML;
				setUser(username, color, "right-user");
			} else {
				show.innerHTML = "<div class='msg_left'><div class='show_user left-user'></div><div class='show_msg'><div class='show_text'>"+ msg + "</div></div></div>" + show.innerHTML;
				setUser(username, color, "left-user");
			}
		}
	}
}